import request from "@/utils/request";

/**
 * 签约主体
 *
 */
export const contractSignList = () =>
  request({
    url: "/contract/sign/pageList",
    method: "get"
  });
/**
 * 合同客户
 *
 */
export const customerList = () =>
  request({
    url: "/contract/info/manage/customerList",
    method: "get"
  });
/**
 * 合同类型
 *
 */
export const typeList = () =>
  request({
    url: "/contract/template/type/list",
    method: "get"
  });
/**
 * 查看合同
 *
 */
export const contract = contractId =>
  request({
    url: "/contract/info/manage/" + contractId,
    method: "get"
  });

/*
 * 合同列表
 * */
export const contracList = data =>
  request({
    url: "/contract/info/manage/pageList",
    method: "post",
    data
  });
/*
 * 作废合同
 * */
export const deleteManage = data =>
  request({
    url: "/contract/info/manage/nullify",
    method: "post",
    data
  });
/*
 * 作废合同
 * */
export const uploadFile = data =>
  request({
    url: "/contract/info/manage/uploadFile",
    method: "post",
    data
  });
/*
 * 发起电子签约
 * */
export const initiate = data =>
  request({
    url: "/contract/sign_contract/sign_contract",
    method: "post",
    data
  });
/**
 * 查询签约合同
 *
 */
export const imgDetail = contractId =>
  request({
    url: "/contract/info/manage/getContractFile/" + contractId,
    method: "get"
  });
/**
 * 下载签约合同
 *
 */
export const contractFileDown = contractId =>
  request({
    url: "/contract/info/manage/getContractFileDown/" + contractId,
    method: "get"
  });
/*
 * 校验是否能够发起关联增减项单的售后单
 * */
export const checkReform = contractId =>
  request({
    url: `/crm/reform/${contractId}/check-add-reform`,
    method: "get"
  });
